<?php
$servername = "localhost";
$username = "yosephaider";
$password = "adminbd";
$dbname = "adv-letsgo";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Conneccion fallida: " . $conn->connect_error);
}

if( !get_magic_quotes_gpc() ){
  $cod = addslashes ($_POST['cedula']);
  $nom = addslashes ($_POST['nombre']);
  $ape = addslashes ($_POST['apellido']);
  $dir = addslashes ($_POST['direccion']);
  $tel = addslashes ($_POST['telefono']);
  $ema = addslashes ($_POST['email']);
  $cla = addslashes ($_POST['clave']);
}else{
  $cod = $_POST['cedula'];
  $nom = $_POST['nombre'];
  $ape = $_POST['apellido'];
  $dir = $_POST['direccion'];
  $tel = $_POST['telefono'];
  $ema = $_POST['email'];
  $cla = $_POST['clave'];

}

$sql = "INSERT INTO Usuarios (cedula, nombre, apellido, direccion, telefono, email, clave) VALUES ('$cod', '$nom', '$ape', '$dir', '$tel', '$ema', '$cla')";
if ($conn->query($sql) === TRUE) {
    echo "New record created successfully";
} else {
    echo "Error: " . $sql . "<br>" . $conn->error;
}

$conn->close();
?> 
  
  
  
<html>
<head>
<title>Registro De Usuario</title>
</head>

<body>

<h1><strong>Registro de Usuarios</strong></h1>

<form method="post" action="<?php $_PHP_SELF ?>">


  
Cedula: <input name="cedula" type="text" id="cedula" size="28" maxlength="12" placeholder="V-17793879" /> <br>
Nombre: <input name="nombre" type="text" id="nombre" size="28" maxlength="16" placeholder="Pedro" /> <br>
Apellido: <input name="apellido" type="text" id="apellido" size="28" maxlength="16" placeholder="Suarez" /> <br>
Direccion: <input name="direccion" type="text" id="direccion" size="28" maxlength="128" placeholder="Domingo salazar 03-02" /> <br>
Telefono: <input name="telefono" type="text" id="telefono" size="28" maxlength="11" placeholder="0424-2346216" /> <br>
Email: <input name="email" type="text" id="email" size="28" maxlength="64" placeholder="jre@gmail.com" /> <br>
Clave: <input name="clave" type="text" id="clave" size="28" maxlength="10" placeholder="xxxxx" /> <br>

<input type="submit" name="ok" id="ok" value="Aceptar" />
</form>
  
</body>
</html>

